<template>
  <transition name="slide-right">
    <div class="content">
      <div class="content-wapper" v-if="bookAvailable">
        <div class="content-item" v-for="(item, index) in navigation.toc" :key="index" @click="jumpTo(item.href)">
          <span class="text">{{item.label}}</span>
        </div>
      </div>
      <div class="empty" v-else>加载中...</div>
    </div>
  </transition>
</template>

<script>
export default {
  props: {
    ifShowContent: Boolean,
    navigation: Object,
    bookAvailable: Boolean
  },
  methods: {
    jumpTo(target) {
      this.$emit('jumpTo', target)
    }
  }
}

</script>
<style lang='scss' scoped>
@import '../assets/styles/global';
.content{
    position: absolute;
    z-index: 102;
    top: 0px;
    left: 0;
    right: px2rem(100);
    height: 100%;
    width: 80%;
    .content-wapper{
      background: white;
      width: 100%;
      height: 100%;
      overflow: auto;
      .content-item{
        display: flex;
        padding: px2rem(10) px2rem(20);
        border-bottom: px2rem(1) solid #ccc;
        .text{
          font-size: px2rem(14);
        }
      }
    }
}
</style>
